//package com.zhihuiyanche.common.util;
//
//import java.util.ArrayList;
//import java.util.List;
//
//import net.sf.json.JSONObject;
//
//public class WechatDataInitUtil
//{
//	/**
//	 * 获取要初始化的管理信息分类的基础数据
//	 * @param tenantid
//	 * @return
//	 */
//	public static List<JSONObject> getDocList(String tenantid){
//		List<JSONObject> list = new ArrayList<JSONObject>();
//		String[] doc_array = new String[]{"三大特色","四大优势","默认","最新活动","美食推荐","加盟优势"};
//		for(int i=0;i<doc_array.length;i++){
//			JSONObject json = new JSONObject();
//			json.put("tenancy_id", tenantid);
//			json.put("name", doc_array[i]);
//			json.put("issystem", true);
//			list.add(json);
//		}
//		return list;
//	}
//	/**
//	 * 获取初始化游戏列表数据
//	 * @return
//	 */
//	public static List<JSONObject> getGameList(String tenantid){
//		List<JSONObject> list = new ArrayList<JSONObject>();
//		JSONObject egg = new JSONObject();
//		egg.put("type", "egg");
//		egg.put("describe", "砸金蛋");
//		egg.put("drawcount", "10");
//		egg.put("introduce", "砸金蛋");
//		egg.put("name", "砸金蛋");
//		egg.put("tenancy_id", tenantid);
//		egg.put("game_status", 0);
//		egg.put("game_seq", 0);
//		list.add(egg);
//		JSONObject redbag = new JSONObject();
//		redbag.put("type", "redbag");
//		redbag.put("describe", "抢红包");
//		redbag.put("drawcount", "10");
//		redbag.put("introduce", "抢红包");
//		redbag.put("name", "抢红包");
//		redbag.put("tenancy_id", tenantid);
//		redbag.put("game_status", 0);
//		redbag.put("game_seq", 0);
//		list.add(redbag);
//		JSONObject draw = new JSONObject();
//		draw.put("type", "draw");
//		draw.put("describe", "大转盘");
//		draw.put("drawcount", "10");
//		draw.put("introduce", "大转盘");
//		draw.put("name", "大转盘");
//		draw.put("tenancy_id", tenantid);
//		draw.put("game_status", 0);
//		draw.put("game_seq", 0);
//		list.add(draw);
//		return list;
//	}
//	/**
//	 * 获取初始化页面内部菜单数据(一级菜单)
//	 * @return
//	 */
//	public static List<JSONObject> getMenuList(String tenantid,String projectName){
//		List<JSONObject> list = new ArrayList<JSONObject>();
//		String host = Constant.getSystemMap().get("product_wechat_service_ip");
//		//JSONObject bean1 = WechatDataInitUtil.getMenuBean(tenantid, "0", "1", "首页", host+projectName+"/pages/weixin/front2/home/home.jsp", "false", "0");
//		//list.add(bean1);
//		JSONObject bean2 = WechatDataInitUtil.getMenuBean(tenantid, "0", "1", "门店", host+projectName+"/pages/weixin/newfront/store_list.jsp", "false", "0");
//		list.add(bean2);
//		//JSONObject bean3 = WechatDataInitUtil.getMenuBean(tenantid, "2", "1", "预订", host+projectName+"/pages/weixin/front2/reserve/reserve_seat.jsp", "false", "0");
//		//list.add(bean3);
//		//JSONObject bean4 = WechatDataInitUtil.getMenuBean(tenantid, "3", "1", "排号", host+projectName+"/pages/weixin/front2/arrange/row_number.jsp", "false", "0");
//		//list.add(bean4);
//		//JSONObject bean6 = WechatDataInitUtil.getMenuBean(tenantid, "4", "1", "票劵", host+projectName+"/pages/weixin/front2/marketService/micro_purchase_volume.jsp", "false", "0");
//		//list.add(bean6);
//		JSONObject bean7 = WechatDataInitUtil.getMenuBean(tenantid, "1", "1", "游戏活动", host+projectName+"/pages/weixin/front2/home/earnMoney.jsp", "false", "0");
//		list.add(bean7);
//		JSONObject bean5 = WechatDataInitUtil.getMenuBean(tenantid, "2", "1", "会员", host+projectName+"/pages/weixin/front2/wallet/member_manage.jsp", "false", "0");
//		list.add(bean5);
//		return list;
//	}
//	/**
//	 * 获取初始化页面内部菜单数据(二级菜单)
//	 * @return
//	 */
//	public static List<JSONObject> getSecondMenuList(String tenantid,List<JSONObject> param,String projectName){
//		List<JSONObject> list = new ArrayList<JSONObject>();
//		String host = Constant.getSystemMap().get("product_wechat_service_ip");
//		for(int i=0;i<param.size();i++){
//			JSONObject first = param.get(i);
//			if(first.optString("name").equals("预订")){
//				JSONObject bean1 = WechatDataInitUtil.getMenuBean(tenantid, "0", "2", "预订桌位", host+projectName+"/pages/weixin/front2/reserve/reserve_seat.jsp", "false", first.optString("id"));
//				list.add(bean1);
//				JSONObject bean2 = WechatDataInitUtil.getMenuBean(tenantid, "1", "2", "送餐上门", host+projectName+"/pages/weixin/front2/reserve/room_door.jsp", "false", first.optString("id"));
//				list.add(bean2);
//				JSONObject bean3 = WechatDataInitUtil.getMenuBean(tenantid, "2", "2", "到店点餐", host+projectName+"/pages/weixin/front2/reserve/store_meal_2.jsp", "false", first.optString("id"));
//				list.add(bean3);
//			}else if(first.optString("name").equals("排号")){
//				JSONObject bean1 = WechatDataInitUtil.getMenuBean(tenantid, "0", "2", "排号等位", host+projectName+"/pages/weixin/front2/arrange/row_number.jsp", "false", first.optString("id"));
//				list.add(bean1);
//				JSONObject bean2 = WechatDataInitUtil.getMenuBean(tenantid, "1", "2", "我的排号", host+projectName+"/pages/weixin/front2/arrange/my_row.jsp", "false", first.optString("id"));
//				list.add(bean2);
//			}
//		}
//		return list;
//	}
//	
//	public static JSONObject getMenuBean(String tenancy_id,String sort_num,String menu_level,String name,String url,
//			String status,String parent_id){
//		JSONObject json = new JSONObject();
//		json.put("tenancy_id", tenancy_id);
//		json.put("sort_num", sort_num);
//		json.put("menu_level", menu_level);
//		json.put("name", name);
//		json.put("url", url);
//		json.put("title", name);
//		json.put("status", status);
//		json.put("parent_id", parent_id);
//		json.put("type", "page");
//		return json;
//	}
//	/**
//	 * 初始化进去微信手机端的模块页面
//	 * @param tenancy_id
//	 * @return
//	 */
//	public static List<JSONObject> getWechatModulesList(String tenancy_id,String projectName){
//		List<JSONObject> list = new ArrayList<JSONObject>();
//		String host = Constant.getSystemMap().get("product_wechat_service_ip");
//		String prefix_url = host + projectName;
//		//将要初始化的数据添加到该部分
//		list.add(getMenuBean(tenancy_id, 0, "微官网模块", prefix_url+"/pages/weixin/front2/home/home.jsp", true,0));
//		list.add(getMenuBean(tenancy_id, 1, "菜品车", prefix_url+"/pages/weixin/front2/reserve/dish_car.jsp", true,0));
//		list.add(getMenuBean(tenancy_id, 2, "加盟模块", prefix_url+"/pages/weixin/front2/home/join.jsp", true,0));
//		list.add(getMenuBean(tenancy_id, 3, "会员资料", prefix_url+"/pages/weixin/front2/wallet/personal_center.jsp", true,0));
//		list.add(getMenuBean(tenancy_id, 4, "微会员模块", prefix_url+"/pages/weixin/front2/wallet/member_manage_1.jsp", true,0));
//		list.add(getMenuBean(tenancy_id, 5, "注册会员", prefix_url+"/pages/weixin/front2/wallet/bindmobile.jsp", true,0));
//		list.add(getMenuBean(tenancy_id, 6, "微门店模块", prefix_url+"/pages/weixin/front2/store/store_list.jsp", true,0));
//		list.add(getMenuBean(tenancy_id, 7, "优惠规则", prefix_url+"/pages/weixin/front2/wallet/preferential_rule.jsp", true,0));
//		list.add(getMenuBean(tenancy_id, 8, "到店点餐", prefix_url+"/pages/weixin/front2/reserve/store_meal_2.jsp", true,0));
//		list.add(getMenuBean(tenancy_id, 9, "充值消费", prefix_url+"/pages/weixin/front2/wallet/my_card_1.jsp", true,0));
//		list.add(getMenuBean(tenancy_id, 10, "外卖", prefix_url+"/pages/weixin/front2/reserve/room_door.jsp#take", true,0));
//		list.add(getMenuBean(tenancy_id, 11, "我的订单", prefix_url+"/pages/weixin/newfront/myorder.jsp", true,0));
//		list.add(getMenuBean(tenancy_id, 12, "自提", prefix_url+"/pages/weixin/front2/reserve/room_door.jsp#refer", true,0));
//		list.add(getMenuBean(tenancy_id, 13, "积分商城", "", false,0));
//		list.add(getMenuBean(tenancy_id, 14, "排号", prefix_url+"/pages/weixin/front2/arrange/row_number.jsp", true,0));
//		list.add(getMenuBean(tenancy_id, 15, "微客服", prefix_url+"/pages/weixin/front2/home/customer.jsp", true,0));
//		list.add(getMenuBean(tenancy_id, 16, "菜品", prefix_url+"/pages/weixin/front2/reserve/dishs_page.jsp", true,0));
//		list.add(getMenuBean(tenancy_id, 17, "微社区", "http://buluo.qq.com/mobile/barindex.html?from=weixin&bid=257329", true,0));
//		list.add(getMenuBean(tenancy_id, 18, "公司名片", "", false,0));
//		list.add(getMenuBean(tenancy_id, 19, "微活动", prefix_url+"/pages/weixin/front2/home/panic_buy.jsp", true,1));
//		list.add(getMenuBean(tenancy_id, 20, "新闻中心", prefix_url+"/pages/weixin/front2/home/activityList.jsp", true,0));
//		list.add(getMenuBean(tenancy_id, 21, "微游戏", prefix_url+"/pages/weixin/front2/home/earnMoney.jsp", true,1));
//		list.add(getMenuBean(tenancy_id, 22, "会员卡", prefix_url+"/pages/weixin/front2/wallet/my_card_1.jsp", true,0));
//		list.add(getMenuBean(tenancy_id, 23, "文章", prefix_url+"/pages/weixin/front2/home/articleList.jsp", true,1));
//		list.add(getMenuBean(tenancy_id, 24, "积分", prefix_url+"/pages/weixin/front2/wallet/my_integral.jsp", true,0));
//		list.add(getMenuBean(tenancy_id, 25, "优惠劵", prefix_url+"/pages/weixin/front2/wallet/my_coupon.jsp", true,0));
//		list.add(getMenuBean(tenancy_id, 26, "微点餐", prefix_url+"/pages/weixin/newfront/store_list.jsp", true,0));
//		return list;
//	}
//	
//	/**
//	 * 
//	 * @param tenancy_id
//	 * @param sort_num	显示的顺序，无其他意义
//	 * @param name	模块名称
//	 * @param url	模块链接
//	 * @param status	模块开通状态 true:开通 false:未开通
//	 * @param parentId	是否允许赋值显示链接 0:可以1：不可以
//	 * @return
//	 */
//	public static JSONObject getMenuBean(String tenancy_id,int sort_num,String name,String url,boolean status,int parentId){
//		JSONObject json = new JSONObject();
//		json.put("tenancy_id", tenancy_id);
//		json.put("sort_num", sort_num);
//		json.put("name", name);
//		String[] temp = url.split("#");
//		if(temp[0].indexOf("?")>=0){
//			temp[0] += "&tenantId="+tenancy_id;
//		}else{
//			temp[0] += "?tenantId="+tenancy_id;
//		}
//		if(temp.length>1 && MyUtil.checkEmpty(temp[1])){
//			url = temp[0]+"#"+temp[1];
//		}else{
//			url = temp[0];
//		}
//		json.put("url", url);
//		json.put("title", name);
//		json.put("status", status);
//		json.put("parent_id", parentId);
//		json.put("type", "modules");
//		return json;
//	}
//	
//	/**
//	 * 组织公众号授权类型数据的初始化
//	 * @return
//	 */
//	public static JSONObject initWechatType(String tenancyId){
//		JSONObject bean = new JSONObject();
//		bean.put("store_id", "0");
//		bean.put("system_name", "WECHAT");
//		bean.put("model_name", "微信公众号授权类型");
//		bean.put("para_name", "微信公众号授权类型");
//		bean.put("para_code", "wechat_authorize");
//		bean.put("para_value", "Y");
//		bean.put("para_defaut", "Y");
//		bean.put("para_type", "初始化");
//		bean.put("valid_state", "1");
//		bean.put("para_remark", "Y：普通授权 N:第三方授权");
//		bean.put("tenancy_id", tenancyId);
//		return bean;
//	}
//}
